POV-Ray : Newsgroups : povray.general : Convert string identifier to object name : Re: Convert string identifier to object name Server Time
30 Jul 2024 04:15:47 EDT (-0400)
  Re: Convert string identifier to object name  
From: Thomas de Groot
Date: 2 Nov 2009 07:34:50
Message: <4aeed1ea@news.povray.org>
"Chris B" <nom### [at] nomailcom> schreef in bericht 
news:4aeec1dc@news.povray.org...
> I assume that an object called 'Beggar_' is declared within the include 
> file?

Yes indeed.

> If so you could use the Parse_String(String) macro. This macro takes a 
> string, writes it to a file, and then includes that file, effectively 
> evaluating the string, so:
>
> #include "strings.inc"
> Parse_String(concat("object {",PoserName,"}"))
>

Perfect Chris! It works. I just  changed my code line to:

#local ObjName = Parse_String(concat("object {",PoserName,"}"))

and used that for further work in the scene.

Thomas

PS I shall have to look into strings.inc to discover what more is hidden 
there :-)  Fact is that I do not know *everything* that POV-Ray offers....


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.